﻿<%@ Page Title="" Language="C#" MasterPageFile="~/NewMasterPage.master" AutoEventWireup="true" CodeFile="Folder.aspx.cs" Inherits="FolderPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="static/js/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
    <link href="static/js/css/redmond/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function () {

            $(".dialog").dialog({
                width: 460,
                modal: true,
                autoOpen: false,
                buttons: {
                    "Close": function () {
                        $(this).dialog("close");
                    }
                },
                open: function (type, data) {
                    $(this).parent().appendTo("form");
                }
            });

            $(".datepicker").datepicker({ dateFormat: 'M d, yy' });

        });
    </script>
    <style type="text/css">
        .ui-datepicker
        {
            z-index: 1003; /* must be > than popup editor (1002) */
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMain" runat="Server">
    <div class="mbox">
        <h1>
            <asp:HiddenField ID="hdfDocumentCode" runat="server" />
            <a href="#">
                <%=FolderName%></a></h1>
        <div class="text">
            <asp:Panel ID="pnlView" runat="server">
            <table cellpadding="2" cellspacing="0" border="0" style="width: 100%">
                <tr>
                    <td colspan="2">
                        <h3 style="margin: 0">
                            全部档案</h3>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <div class="text">
                                <asp:GridView ID="gvDocuments" runat="server" CellPadding="4" ForeColor="#333333"
                                            GridLines="Vertical" AutoGenerateColumns="False" Width="100%" 
                                    ShowHeaderWhenEmpty="True" OnRowCommand="gvDocuments_RowCommand" 
                                    AllowPaging="True" onpageindexchanging="gvDocuments_PageIndexChanging" >
                                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                    <Columns>
                                        <asp:TemplateField ShowHeader="False">
                                            <ItemTemplate>
                                            <a id="lnk" onclick="$('#<%=hdfDocumentCode.ClientID %>').val('<%# Eval("Document_Code") %>');$('#dialogShareDocument').dialog('open');" style="color: #FFFFFF; display: none;">公开</a>
                                                        
                <% if (Author.user_Code == _assgin_code)
                   { %>
                                                <asp:LinkButton ID="LinkButton1" runat="server"
                                                    CommandName="Del"  CommandArgument='<%# Eval("Document_Code") %>' Text="删除" />
                                                    <% } %>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                                <asp:TemplateField HeaderText="名称/备注">
                                                    <ItemTemplate>
                                                        <strong>
                                                <a href="javascript:window.open( 'viewdocument.aspx?doc=<%# Eval("Document_Code") %>', null, 'status=yes,toolbar=no,menubar=no,location=no ');"  ><%#Eval("Document_Name")%></a>
                                                            </strong>
                                                        <br />
                                                        <span>
                                                            <%#Eval("Document_Desc")%></span>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                        <asp:BoundField HeaderText="负责人" DataField="OwnerName"/>
                                        <asp:BoundField HeaderText="文件类型" DataField="DocumentType"/>
                                        <asp:BoundField HeaderText="创建时间" DataField="Creation_Date"/>
                                        <asp:BoundField HeaderText="更新时间" DataField="Updation_Date"/>
                                        <asp:BoundField HeaderText="收到时间" DataField="Recieved_Date"/>
                                    </Columns>
                                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                    <EditRowStyle BackColor="#999999" />
                                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                </asp:GridView>
                        </div>
                            <div id="dialogShareDocument" title="公开" class="dialog">
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="True" UpdateMode="Always">
                                    <ContentTemplate>
                                        <table border="0">
                                            <tr>
                                                <td>
                                                    部门:
                                                </td>
                                                <td>
                                                    &nbsp;
                                                    <asp:DropDownList ID="ddlDepartment" runat="server">
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    姓名:
                                                </td>
                                                <td>
                                                    &nbsp;
                                                    <asp:DropDownList ID="ddlUsers" runat="server">
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    备注:
                                                </td>
                                                <td>
                                                    &nbsp;
                                                    <asp:TextBox ID="txtUserDocumentDesc" runat="server" Height="100px" TextMode="MultiLine"
                                                        Width="250px"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblStatus" runat="server" ForeColor="Red" Visible="False" />
                                                </td>
                                                <td>
                                                    &nbsp;
                                                    <asp:Button ID="btnAddTask" runat="server" Text="确认" OnClick="btnShareDocument_Click" />
                                                    &nbsp;&nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                        <script type="text/javascript">
                                            //load a handler to the Sys.Application
                                            Sys.Application.add_load(ApplicationLoadHandler);
                                            function ApplicationLoadHandler(sender, args) {
                                                //get the page Manager Object
                                                var prm1 = Sys.WebForms.PageRequestManager.getInstance();
                                                //verify state of postback
                                                if (!prm1.get_isInAsyncPostBack()) {
                                                    prm1.add_endRequest(endRequest);
                                                }
                                            }
                                            function endRequest(sender, args) {
                                                $(".datepicker").datepicker({ dateFormat: 'M d, yy' });

                                            }
                                        </script>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
            </asp:Panel>
        </div>
        <div class="footer">
            <div class="bookmarks">
                <a href="Default.aspx">回到首页</a>
            </div>
            <a href="Compose.aspx">发送信息</a>
            <% if (Author.user_Code == _assgin_code)
               { %>|
            <asp:LinkButton ID="btnUpload" runat="server" OnClick="btnUpload_Click">上传文件</asp:LinkButton>
            <% } %>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphSide" runat="Server">
</asp:Content>